#include "stdafx.h"
#include "log.h"


TCHAR* __pcFlyLogLevel__[] = {
	TEXT("ERR"),
	TEXT("WARN"),
	TEXT("TRACE"),
	TEXT("DUMP"),
	TEXT("DBG"),
};

CString X_Dump(void* p,int len)
{
	CString Out(_T('\0'),len*3+1);
	CString strTmp;
	for (int i=0;i<len;++i)
	{
		strTmp.Format(_T(" %02x"),static_cast<byte*>(p)[i]);
		Out.SetAt(i*3,strTmp[0]);
		Out.SetAt(i*3+1,strTmp[1]);
		Out.SetAt(i*3+2,strTmp[2]);
	}
	Out.SetAt(Out.GetLength()-1,_T('.'));
	return Out;
}